package com.devicemantra.coordinate.operations;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.devicemantra.coordinate.exceptions.operations.COperationNotImplementedException;
import com.devicemantra.coordinate.jaxb.OperationType;

public class COperationFactory {
	
	public static COperation getServiceImpl(OperationType pType) throws COperationNotImplementedException
	{
		COperation lOperation = null;
		switch(pType)
		{
			case ADD_STATE:
								lOperation = new AddStateImpl();
								break;
			case DELETE_STATE:
								lOperation = new DeleteStateImpl();
								break;
			case ADD_DEPARTMENT:
								lOperation = new AddDepartmentImpl();
								break;
			case DELETE_DEPARTMENT:
								lOperation = new DeleteDepartmentImpl();
								break;
								
			case ADD_USER:
								lOperation = new AddUserImpl();
								break;
			case MODIFY_USER:
								lOperation = new ModiyUserImpl();
								break;
			case DELETE_USER: 
								break;
								
			case ADD_LOCATION:
								lOperation = new AddLocationImpl();
								break;
			case MODIFY_LOCATION:
								lOperation = new ModifyLocationImpl();
								break;
								
			case ADD_GROUP:
								lOperation = new AddGroupImpl();
								break;
			case MODIFY_GROUP:
								lOperation = new ModifyGroupImpl();
								break;
				
			case DELETE_GROUP:
								//lOperation = new DeleteGroupImpl();
								break;
								
			case SEND_MESSAGE:
								lOperation = new SendMessageImpl();
								break;													
								
			default:
								System.out.println("PANIC : Unsupported Operation request !!");
								throw new COperationNotImplementedException();
								
		}
		return lOperation;
	}

}
